#include <stdio.h>

/* Calculation shows that when we have 276 cards, the length is 5.203037139,
 * and it is the smallest length greater than 5.20. So we need at most 276
 * cards.
 */
#define MAX_CARDS 276

int main()
{
    double length[MAX_CARDS+1], target;
    int n;

    /* Pre-build the table. */
    length[0] = 0.0;
    for (n = 1; n <= MAX_CARDS; n++)
        length[n] = length[n-1] + 1.0 / (n + 1);

    /* Read each query and perform a binary search. */
    while (scanf("%lf", &target) == 1 && target != 0.0)
    {
        /* Find the smallest n such that length[n] >= target. */
        int lower = 0, upper = MAX_CARDS;
        while (lower < upper)
        {
            int mid = lower + (upper - lower) / 2;
            if (length[mid] < target)
                lower = mid + 1;
            else
                upper = mid;
        }
        printf("%d card(s)\n", upper);
    }
    return 0;
}
